package MIDI.XMIDI is

   type Timbre_Type is record
      Patch : Unsigned_8;
      Bank  : Unsigned_8;
   end record;

   type Timbre_Array is array(Unsigned_16 range <>) of Timbre_Type; 

   type Trunk_Path_Type is array(Positive range <>) of String(1..4);

   type XMI_File_Type is tagged limited record
      File      : Stream_IO.File_Type;
      As_Stream : Stream_IO.Stream_Access;
   end record;

   procedure Open (this : in out XMI_File_Type; Filename : String);

   procedure Visit (
      this : in out XMI_File_Type;
      On_INFO, On_TIMB, On_RBRN, On_EVNT : access function return Boolean := null;
      On_Trunk_Begin, On_Trunk_End : access procedure (T : Trunk_Head_Type) := null;
      On_Path_Begin, On_Path_End : access procedure (Name : Trunk_Name_Type) := null
      );

   function Read_Text (
      this : in out XMI_File_Type;
      Size : Uint32_be
      ) return String;

   function End_Of_File (this : XMI_File_Type) return Boolean;

   procedure Next (
      this : in out XMI_File_Type;
      Size : Uint32_be
      );

   procedure Close (this : in out XMI_File_Type);

end MIDI.XMIDI;

